package cn.itcast.demo;

import java.io.File;
import java.net.URL;
import java.nio.file.Files;

import org.junit.Test;

public class demo {
	
	@Test
	public void test() {
		String basePackage = "cn.itcast";
//		URL url = demo.class.getClassLoader().getResource("/" + basePackage.replaceAll("\\.", "/"));
		URL url = this.getClass().getClassLoader().getResource("cn/itcast");
		File file = new File(url.getFile());
		doScan(file);
	}

	private void doScan(File file) {
	
		File[] listFiles = file.listFiles();
		for (File file2 : listFiles) {
			if(file2.isDirectory()) {
				doScan(file2);
			}else {
				System.out.println("cn.itcast"+"."+file2.getName());
			}
		}
		
	}

}
